/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ourgame.tankgame.attribute;

import com.jme3.math.FastMath;
import com.jme3.math.Vector3f;

/**
 *
 * @author Lcn
 */
public class TankAttribute {

    private float stiffness = 120.0f;//200=f1 car
    private float compValue = 0.2f; //(lower than damp!)
    private float dampValue = 0.3f;
    private float maxSuspensionForce = 10000;
    private float mass = 400;
    
    private Vector3f wheelDirection = new Vector3f(0, -1, 0);
    private Vector3f wheelAxle = new Vector3f(1, 0, 0);

    /**
     * 
     * @return 悬挂压缩
     */
    public float getSuspensionCompression() {
        return getCompValue() * 2.0f * FastMath.sqrt(getStiffness());
    }

    /**
     * 
     * @return 减震
     */
    public float getSuspensionDamping() {
        return getDampValue() * 2.0f * FastMath.sqrt(getStiffness());
    }

    /**
     * 
     * @return 悬挂刚度
     */
    public float getSuspensionStiffness() {
        return getStiffness();
    }

    public float getMaxSuspensionForce() {
        return maxSuspensionForce;
    }

    /**
     * @return the stiffness
     */
    public float getStiffness() {
        return stiffness;
    }

    /**
     * @param stiffness the stiffness to set
     */
    public void setStiffness(float stiffness) {
        this.stiffness = stiffness;
    }

    /**
     * @return the compValue
     */
    public float getCompValue() {
        return compValue;
    }

    /**
     * @param compValue the compValue to set
     */
    public void setCompValue(float compValue) {
        this.compValue = compValue;
    }

    /**
     * @return the dampValue
     */
    public float getDampValue() {
        return dampValue;
    }

    /**
     * @param dampValue the dampValue to set
     */
    public void setDampValue(float dampValue) {
        this.dampValue = dampValue;
    }

    /**
     * @param maxSuspensionForce the maxSuspensionForce to set
     */
    public void setMaxSuspensionForce(float maxSuspensionForce) {
        this.maxSuspensionForce = maxSuspensionForce;
    }

    /**
     * @return the mass
     */
    public float getMass() {
        return mass;
    }

    /**
     * @param mass the mass to set
     */
    public void setMass(float mass) {
        this.mass = mass;
    }

    /**
     * @return the wheelDirection
     */
    public Vector3f getWheelDirection() {
        return wheelDirection;
    }

    /**
     * @param wheelDirection the wheelDirection to set
     */
    public void setWheelDirection(Vector3f wheelDirection) {
        this.wheelDirection = wheelDirection;
    }

    /**
     * @return the wheelAxle
     */
    public Vector3f getWheelAxle() {
        return wheelAxle;
    }

    /**
     * @param wheelAxle the wheelAxle to set
     */
    public void setWheelAxle(Vector3f wheelAxle) {
        this.wheelAxle = wheelAxle;
    }
}
